<?php

use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;

class CreateWithdrawBindLogTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('withdraw_account_log', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('user_id')->default(0)->comment('拨打用户ID');
            $table->tinyInteger('bind_op')->default(1)->comment('操作：1-绑定，0-解绑');
            $table->tinyInteger('account_type')->default(0)->comment('0-支付宝，1-银行卡');
            $table->string('account', 100)->default('')->comment('频道ID');
            $table->timestamps();
            $table->index('user_id', 'user_id');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('withdraw_account_log');
    }
}
